#ifndef QHOSTFACTORY_H
#define QHOSTFACTORY_H

#include "corelibglobal.h"

#include <QMetaObject>
#include <QMap>
#include <QString>

class QAbstractHost;
class XMLObject;


struct tagHostInfo {
    const QMetaObject *m_host_meta_object;
    QString m_id;
    QString m_icon;
    QString m_name;
    QString m_group;
    QString m_svgCode;
};

class CORELIB_EXPORT QHostFactory
{
protected:
    QHostFactory();

public:
    static void registerHost(const QString id, QString icon, QString name, QString group,QString svgCode, const QMetaObject *host);
    static QAbstractHost* createHost(const QString id);
    static QMap<QString, tagHostInfo*> getHostInfo();
    static QAbstractHost* createHost(XMLObject* xml);
    static tagHostInfo* getHostInfo(const QString id);

protected:
    static QMap<QString, tagHostInfo*> m_host_map;
};

#endif // QHOSTFACTORY_H
